5 CLS:KEY OFF
10 REM PRECISION PROGRAM v1.83 by N. ADAMS
20 REM This program will calculate within run,run to run, and day to day
30 REM precision.
32 CLEAR
34 INPUT "Title: ";TI$
35 INPUT "Enter number of days of data collected ";N
40 OPTION BASE 1
50 DIM A(N,4),B(N,2),C(N,4),D(N),E(N,2),G(N)
60 PRINT "ENTER EACH DAYS VALUES AS FOLLOWS:"
70 PRINT "RUN 1 VALUE 1,RUN 1 VALUE 2,RUN 2 VALUE 1, RUN 2 VALUE 2"
80 FOR I =1 TO N:INPUT "DATA ";A(I,1),A(I,2),A(I,3),A(I,4)
90 NEXT I
100 FOR I =1 TO N:
110       B(I,1) = (A(I,1) + A(I,2))/2
120       B(I,2) = (A(I,3) + A(I,4))/2
130 NEXT I
140 FOR I = 1 TO N:
150       C(I,1) = (A(I,1) - B(I,1))^2
160       C(I,2) = (A(I,2) - B(I,1))^2
170       C(I,3) = (A(I,3) - B(I,2))^2
180       C(I,4) = (A(I,4) - B(I,2))^2
190 NEXT I
200 S=0
210 FOR I = 1 TO N:
220 FOR J = 1 TO 4:
230    S = S+C(I,J)
240 NEXT J
250 NEXT I
260 WR = S/(2*N)
265 WRP = SQR(WR)
270 PRINT "WITHIN RUN PRECISION = ",WRP
280 FOR I = 1 TO N: D(I) = (B(I,1) + B(I,2))/2
290 NEXT I
300 T = 0
310 FOR I = 1 TO N:
320      E(I,1) = (B(I,1) - D(I))^2
330      E(I,2) = (B(I,2) - D(I))^2
340 T = T + E(I,1) + E(I,2)
350 NEXT I
360 RR = (2*T)/N
365 RRP = (RR-WR)/2 :QW = SQR(RRP)
370 PRINT:PRINT "RUN TO RUN PRECISION = ",QW
380 L = 0
390 FOR I = 1 TO N:L = L + D(I)
400 NEXT I
410 F = L/N
420 H = 0
430 FOR I = 1 TO N:
440      G(I) = (D(I) - F)^2
450 H = H + G(I)
460 NEXT I
470 PR = (4*H)/(N-1)
475 PRP = (PR-RR)/4 :ZW =SQR(PRP)
480 PRINT :PRINT "DAY TO DAY PRECISION = ",ZW
485 LPRINT TI$:LPRINT
490 LPRINT SPC(20) "RUN 1" SPC(25) "RUN 2"
495 LPRINT "DAY","REP 1","REP 2","REP 1","REP 2"
500 FOR I = 1 TO N:
510 LPRINT I,A(I,1),A(I,2),A(I,3),A(I,4)
520 NEXT I
530 LPRINT:LPRINT:LPRINT
600 LPRINT: LPRINT:LPRINT
610 LPRINT "THE WITHIN RUN PRECISION = ";WRP
620 LPRINT:LPRINT "THE RUN TO RUN PRECISION = ";QW
630 LPRINT:LPRINT "THE DAY TO DAY PRECISION = ";ZW
635 PRINT :PRINT
640 PRINT:INPUT "Continue (C) or End (E): ";ZX$
650 IF ZX$ = "C" OR ZX$ ="c" THEN 10 ELSE 660
660 IF ZX$ ="e" OR ZX$ = "E" THEN 700 ELSE 640
700 CLS: KEY ON
